<template>
	<view>
		
		<view class="seach">
			<u-navbar :is-back="false" :border-bottom="false" :background="background">
				<view class="d-flex a-center j-sb w-100">
					<view class="span-5 pl-2 py-2"  @click="backtrack_img">
						<u-icon name="arrow-left" color="#ffffff" size="40"></u-icon>
					</view>
					<view class="font-lg font-weight text-white">业务员</view>
					<view class="span-5"></view>
				</view>
			</u-navbar>
		</view>
		
		
		<view class="goods_card bg-white m-2 p-3 rounded-20">
			<view class="py-4 px-2 bg-white d-flex j-sb a-center border-bottom yewu" v-for="(item,index) in qiyong" :key='index'>
				<view class="d-flex a-center">
					
					<view class="font-35 text-000 ml-2">
						<view class="d-flex font-weight name">
							{{item.name}}
						</view>
						<view class="d-flex font-weight mobile">
							{{item.mobile}}
						</view>
					</view>
				</view>
				<view class="d-flex a-center" @tap.stop="yewu_detail(item)">
					<view class="touxiang"><image class="terrace_img rounded-circle-50" :src="item.user_picture?item.user_picture:'../../static/images/order/default-photo.png'" mode=""></image></view>
					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
				</view>
			</view>
		</view>
		
		<view class="tingyong-title">
			已停用帐号
		</view>
		
		<view class="goods_card bg-white m-2 p-3 rounded-20">
			<view class="py-4 px-2 bg-white d-flex j-sb a-center border-bottom yewu" v-for="(item,index) in tingyong" :key='index'>
				<view class="d-flex a-center">
					
					<view class="font-35 text-000 ml-2">
						<view class="d-flex font-weight name">
							{{item.name}}
						</view>
						<view class="d-flex font-weight mobile">
							{{item.mobile}}
						</view>
					</view>
				</view>
				<view class="d-flex a-center" @tap.stop="yewu_detail(item)">
					<view class="touxiang"><image class="terrace_img rounded-circle-50" :src="item.user_picture?item.user_picture:'../../static/images/order/default-photo.png'" mode=""></image></view>
					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
				</view>
			</view>
		</view>
		
		<view class="footer"></view>
		<view class="bg-white py-2 w-100 position-fixed bottom-0 btn">
			<button type="warn" @click="addYewu">添加业务员</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				u_loadmore:true, // 加载中
				background: {
					background: '#fa7226',
					backgroundSize: 'cover',
				},
				
				qiyong:"", // 平台列表
				tingyong:"", // 平台列表
				
				more:1, // 第几页
				count:10, // 条数
				total:0,// 总条数
				scrollHeight:0, // 自适应高度
				old: {
					scrollTop: 0
				},
				scrollTop:0,
				firstFocus:false,// 下拉刷新
				triggered: false, // 下拉刷新
				keywords:"", // 关键字
				
				timers:null, // 倒计时
				
				seach_show:null
			}
		},
		onReady() {
			let _this=this
			uni.getSystemInfo({
				success(resu) {
					const query = uni.createSelectorQuery()
					query.select('.footer').boundingClientRect()
					query.exec(function(res) {
						_this.scrollHeight = resu.windowHeight - res[0].top + 'px';
					})
				}
			})
		},
		methods: {
			// 添加分类
			addYewu(){
				uni.navigateTo({
					url:"/pagesB/yewu/add?addClazz="+'添加业务员'
				})
				var globalData = getApp().globalData.closeLists; //获取全局变量
				getApp().globalData.closeLists= '业务员列表'; //修改全局变量
			},
			
			yewu_detail(item){
				uni.navigateTo({
					url:"/pagesB/yewu/edit?yewu_id=" + item.id
				})
				var globalData = getApp().globalData.closeLists; //获取全局变量
				getApp().globalData.closeLists= '业务员列表'; //修改全局变量
			},
			
			// 返回
			backtrack_img(){
				uni.navigateBack({
					delta:1
				})
			},
		},
		onLoad() {
			// 商品分类 merchant merchant
			// this.$H.post("admin/merchant/goods/merchant/category").then(res=>{
			// 	if(res.status.succeed == 1){
			// 		this.u_loadmore=false   
			// 		this.goodsClazz=res.data
			// 		this.goodsClazz.filter((item,index)=>{
			// 				return item.icon_show=false,item.iconshow=false,item.show=false
			// 		})
			// 		this.oneGoods=this.goodsClazz.filter((item,index)=>{
			// 			if(item.parent_id==0){
			// 				this.oneGoods=this.goodsClazz.forEach((v,i)=>{
			// 					if(item.cat_id==v.parent_id){
			// 						return item.iconshow=true
			// 					}
			// 				})
			// 				return item
			// 			}
			// 		})
			// 	}
			// })	
			
			this.$H.post("v2/store/yewu/list",{
				pagination:{
					count:this.count,
					page:this.more
				},
			}).then(res=>{
				this.total=res.paginated.total
				this.qiyong=res.data.qiyong
				this.tingyong=res.data.tingyong
				this.u_loadmore=false
			})
			
			this.u_loadmore=false 
		},
		onShow() {
			var globalData = getApp().globalData.closeLists; //获取全局变量
			getApp().globalData.closeLists= ''; //修改全局变量
			// 商品分类
			
		},
		
	}
</script>

<style>
	.tab_title{
		border: 1px solid #E7484D;
		color: #E7484D;
		border-radius: 40upx;
		overflow: hidden;
	}
	.active_class{
		background-color: #E7484D;
		color: #FFFFFF;
	}
	.btn /deep/ button{
		width: 85%;
		border-radius: 50upx;
		background: linear-gradient(to right,#F31E3E,#FB4F37);
	}
	.footer{
		height: 134upx;
	}
	
	
	.terrace_img{
		width: 120upx;
		height: 120upx;
	}
	.check{
		width: 150upx;
		height: 70upx;
		text-align: center;
		line-height: 70upx;
		font-size: 35upx;
		color: #ff9f30;
		border-radius: 10upx;
		border: 1px solid #EAEAEA;
	}
	.header{
		height: 125upx;
		background-color: #FA7226;
	}
	.h_40{
		height: 40upx;
	}
	
	
	.tingyong-title{
		font-size: 40upx;
		color: #171717;
		padding-left: 30upx;
		line-height: 60upx;
	}
	
	.yewu .name{
		font-size: 40upx;
		color: #171717;
	}
	.yewu .mobile{
		font-size: 40upx;
		color: #797979;
	}
	.yewu .touxiang{
		margin-right: 10upx;
	}
</style>
